package com.home.duy.code.Model;

import java.util.List;
import java.util.Vector;

import javax.swing.AbstractListModel;
import javax.swing.JOptionPane;

import com.home.Entity.TaiKhoan;
import com.home.duy.code.DAO.TaiKhoanDAO;

public class CQListModel extends AbstractListModel{
	
	public CQListModel()
	{
		
	}
	
	private Vector<TaiKhoan> getAllTaiKhoan() {
		Vector<TaiKhoan> tks = new Vector<TaiKhoan>();
		try {
			
			TaiKhoanDAO tkDao = new TaiKhoanDAO();
			List<TaiKhoan> list = tkDao.findAll(TaiKhoan.class);
			for (TaiKhoan tk : list) {
				tks.add(tk);
			}
		} catch (Exception e) {
			//JOptionPane.showMessageDialog(this, e.getMessage(), "Lỗi", JOptionPane.ERROR_MESSAGE);
			e.printStackTrace();
		}

		return tks;
	}
	
	@Override
	public Object getElementAt(int arg0) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public int getSize() {
		// TODO Auto-generated method stub
		return 0;
	}

}
